extends layout

block meta
    link(rel="stylesheet", href="#{options.cdn_path}/js/artDialog/skins/combo?/js/artDialog/skins/default.css&v=#{options.site_version}")

block content
    // 传递参数
    optionsClass = true
    include common/_admin_navbar
    .content
        .header
            h1.page-title 网站信息设置
        ul.breadcrumb
            li
                a(href="/admin") 首页
                span.divider /
            li.active 网站信息
        .container-fluid
            .row-fluid
                .btn-toolbar
                    button.btn.btn-primary.info_btn
                        i.icon-save 
                        | &nbsp;保存
                    a.btn(href="/admin/blog/list") 返回
                    .btn-group
                .well
                    #myTabContent.tab-content
                        #info.tab-pane.active
                            form#info_btn(action="/admin/options/save_update", method="post")
                                input(type="hidden", name="options.id", value="#{options.id}")
                                label 站点名
                                input.input-xlarge(type="text", name="options.site_name", value="#{options.site_name}", required="required")
                                label 域名
                                input.input-xlarge(type="text", name="options.site_url", value="#{options.site_url}", required="required")
                                label git链接
                                input.input-xlarge(type="text", name="options.git_url", value="#{options.git_url}", required="required")
                                label cdn
                                input.input-xlarge(type="text", name="options.cdn_path", value="#{options.cdn_path}", required="required")
                                label Goole作者链接
                                input.input-xlarge(type="text", name="options.google", value="#{options.google}", required="required")
                                label 腾讯微博
                                input.input-xlarge(type="text", name="options.wb_qq", value="#{options.wb_qq}", required="required")
                                label sina微博
                                input.input-xlarge(type="text", name="options.wb_sina", value="#{options.wb_sina}", required="required")
                                label 多说二级域名
                                input.input-xlarge(type="text", name="options.duoshuo_domain", value="#{options.duoshuo_domain}", required="required")
                                label 备案号
                                input.input-xlarge(type="text", name="options.record_number", value="#{options.record_number}")
                                label 网站版本
                                input.input-xlarge(type="text", name="options.site_version", value="#{options.site_version}", required="required")

                include common/_admin_footer

block script
    script(src="#{options.cdn_path}/js/artDialog/jquery.artDialog.min.js?v=#{options.site_version}")
    script
        $(function(){
            $('.info_btn').click(function(){
                var dialog = $.dialog();
                _post('#info_btn', dialog, function(data){
                    if(data.status){
                        dialog.content('保存成功！').lock().time(1000);
                        setTimeout(function(){
                            location.href = '/admin/options';
                        }, 1500);
                    }else{
                        dialog.content('服务器忙，请稍候！').lock().time(2000);
                    }
                });
                return false;
            });
        });